package com.design.cjm.structural.decorator.example1;

/**
 * 装饰者抽象类
 * 扩展自接口抽象类，扩展，接口不需要知道它的存在
 *
 * @Author: Jie Ming Chen
 * @Date: 2018/9/19
 * @Version 1.0
 */
public abstract class Decorator extends Component{

    /**
     * 具体抽象接口
     */
    private Component component;

    public void setComponent(Component component) {
        this.component = component;
    }

    @Override
    void operation() {
        if (component != null) {
            component.operation();
        }
    }
}
